# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=rosdep
pkgver=0.19.0
pkgrel=6
pkgdesc="ROS multi-package manager system dependency tool"
url="http://ros.org/wiki/rosdep"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-yaml py3-catkin-pkg py3-rosdistro py3-rospkg"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-nose py3-mock py3-flake8"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ros-infrastructure/rosdep/archive/$pkgver.tar.gz"
options="!check" # tests are not very robust https://github.com/ros-infrastructure/rosdep/issues/765

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m nose --cover-package=rospkg --with-xunit test
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3e1d5829689646d583da2eaaf3b8bbddec3cb4ca3dc3941ee2697f6367510a4dcff11984fa1792a400f49132778d7869f0a8274e42bc8c04f2e326e6a663c494  rosdep-0.19.0.tar.gz
"
